import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/page/commodity/categories/page/plusCommodityMode/page/plusCommodityByFormField/page/materialSetting/provider/material_setting_provider.dart';
import 'package:boss/ui/widget/custom_list_title.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class MaterialMenuList extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: Consumer<MaterialSettingProvider>(
        builder: (context, materialSettingProvider, child) {
          return ListView.builder(
            padding: EdgeInsets.symmetric(
              horizontal: 30.w,
            ),
            itemBuilder: (context, index) {
              var current = materialSettingProvider.menuMaterials[index];

              return CustomListTitle(
                title: Row(
                  children: <Widget>[
                    Text(
                      current.meterialName,
                      style: TextStyleConstant().normal_1_28,
                    ),
                    Container(
                      margin: EdgeInsets.only(
                        left: 20.w,
                      ),
                      child: Text(
                        '${AmountUtil.price2String(current.meterialPrice)}元',
                        style: TextStyleConstant().normal_1_28,
                      ),
                    ),
                  ],
                ),
              );
            },
            itemCount: materialSettingProvider.menuMaterials.length,
          );
        },
      ),
    );
  }
}
